<!DOCTYPE html>
<html>
  



<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <!-- Global site tag (gtag.js) - Google Analytics -->


  <title>分类: Android | 😄豐Dの个人博客</title>

  
    
<link rel="stylesheet" href="/js/aos/aos.css">

  

  <link rel="icon" type="image/x-icon, image/vnd.microsoft.icon" href="/favicon.ico">
  <link rel="stylesheet" href="https://at.alicdn.com/t/font_1911880_c1nvbyezg17.css">
  <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

  
    <script>
        var themeModelId = '';
        if (themeModelId) {
            localStorage.setItem('modelId', themeModelId);
        }
    </script>
    
    <script src="https://cdn.jsdelivr.net/gh/yuang01/live2d-widget@latest/autoload.js"></script>
    <script>
        var live2dOpen = eval('true') || false;
        if (!live2dOpen) {
            localStorage.setItem('waifu-display', 1609323474481);
        }
    </script>
  
  
<link rel="stylesheet" href="/css/animate.min.css">

  
<link rel="stylesheet" href="/css/style.css">

  
  
    
<link rel="stylesheet" href="/js/fancybox/jquery.fancybox.min.css">

  
  
  <style>
        @media (max-width: 992px) {
            #waifu {
                display: none;
            }
        }
    </style>
    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
<meta name="generator" content="Hexo 5.3.0"></head>

  <script src="/js/jquery3.5.1.js"></script>
  <script src="/js/vue2.6.11.js"></script>
  <link href="/js/danmu/barrager.css" rel="stylesheet">
<script src="/js/danmu/jquery.barrager.js"></script>
  <body>
    <!-- 判断是否为黑夜模式 -->
    <script>
      let isDark = JSON.parse(localStorage.getItem('dark')) || JSON.parse('false');

      if (isDark) {
        $(document.body).addClass('darkModel');
      }
    </script>

    <header class="header bg-color" 
  style="position: fixed; 
  left: 0; top: 0; z-index: 10;width: 100%;"
>
  <div class="header-content">
    <div class="bars">
      <div id="appDrawer" class="sidebar-image">
  <i class="fa fa-bars" aria-hidden="true" @click="showDialogDrawer"></i>
  <transition name="fade">
    <div class="drawer-box_mask" v-cloak style="display: none;" v-show="visible" @click.self="cancelDialogDrawer">
    </div>
  </transition>
  <div class="drawer-box" :class="{'active': visible}">
    <div class="drawer-box-head bg-color">
      <img class="drawer-box-head_logo" src="/medias/logo.png" alt="logo">
      <h3 class="drawer-box-head_title">😄豐Dの个人博客</h3>
      <h5 class="drawer-box-head_desc">Lmfeng Blog</h5>
    </div>
    <div class="drawer-box-content">
      <ul class="drawer-box-content_menu">
        
          <li class="drawer-box-content_item">
            <a href="/" class="menu-item-link">
              
                <i class="fa fa-home" aria-hidden="true"></i>
              
              <span>首页</span>
            </a>
          </li>
        
          <li class="drawer-box-content_item">
            <a href="/archives" class="menu-item-link">
              
                <i class="fa fa-home" aria-hidden="true"></i>
              
              <span>归档</span>
            </a>
          </li>
        
          <li class="drawer-box-content_item">
            <a href="/tags" class="menu-item-link">
              
                <i class="fa fa-tags" aria-hidden="true"></i>
              
              <span>标签</span>
            </a>
          </li>
        
          <li class="drawer-box-content_item">
            <a href="/categories" class="menu-item-link">
              
                <i class="fa fa-bookmark" aria-hidden="true"></i>
              
              <span>分类</span>
            </a>
          </li>
        
          <li class="drawer-box-content_item">
            <a href="/about" class="menu-item-link">
              
                <i class="fa fa-user" aria-hidden="true"></i>
              
              <span>关于</span>
            </a>
          </li>
        
          <li class="drawer-box-content_item">
            <a target="_blank" rel="noopener" href="https://developer.android.google.cn/" class="menu-item-link">
              
                <i class="fa fa-link" aria-hidden="true"></i>
              
              <span>友情链接</span>
            </a>
          </li>
        
        <li class="drawer-box-content_item">
          <a target="_blank" rel="noopener" href="https://github.com/melvin11112015/">
            <i class="fa fa-github" aria-hidden="true"></i>
            <span>Github</span>
          </a>
        </li>
      </ul>
    </div>
  </div>
</div>

<script>
  var body = document.body || document.documentElement || window;
  var vm = new Vue({
    el: '#appDrawer',
    data: {
      visible: false,
      top: 0,
    },
    computed: {
    },
    mounted() {
    },
    methods: {
      showDialogDrawer() {
        this.visible = true;
        // 防止页面滚动，只能让弹框滚动
        this.top = $(document).scrollTop()
        body.style.cssText = 'width: 100%; height: 100%; position: fixed; top: -' + this.top  + 'px; left: 0; overflow: hidden;';
      },
      cancelDialogDrawer() {
        this.visible = false;
        body.removeAttribute('style');
        $(document).scrollTop(this.top)
      }
    },
    created() {}
  })
</script>
    </div>
    <div class="blog-title" id="author-avatar">
      <div class="avatar">
        <img src="/medias/logo.png" alt="logo">
      </div>
      <a href="/" class="logo">😄豐Dの个人博客</a>
    </div>
    <nav class="navbar">
      <ul class="menu">
        
          <li class="menu-item">
            <a href="/" class="menu-item-link">
              
                <i class="fa fa-home" aria-hidden="true"></i>
              
              <span>首页</span>
            </a>
          </li>
        
          <li class="menu-item">
            <a href="/archives" class="menu-item-link">
              
                <i class="fa fa-archive" aria-hidden="true"></i>
              
              <span>归档</span>
            </a>
          </li>
        
          <li class="menu-item">
            <a href="/tags" class="menu-item-link">
              
                <i class="fa fa-tags" aria-hidden="true"></i>
              
              <span>标签</span>
            </a>
          </li>
        
          <li class="menu-item">
            <a href="/categories" class="menu-item-link">
              
                <i class="fa fa-bookmark" aria-hidden="true"></i>
              
              <span>分类</span>
            </a>
          </li>
        
          <li class="menu-item">
            <a href="/about" class="menu-item-link">
              
                <i class="fa fa-user" aria-hidden="true"></i>
              
              <span>关于</span>
            </a>
          </li>
        
          <li class="menu-item">
            <a target="_blank" rel="noopener" href="https://developer.android.google.cn/" class="menu-item-link">
              
                <i class="fa fa-link" aria-hidden="true"></i>
              
              <span>友情链接</span>
            </a>
          </li>
        
      </ul>
      
        <div class="dark">
  <div class="dark-content">
    <i class="fa fa-moon-o" aria-hidden="true"></i>
    <!-- <span>关灯</span> -->
  </div>
  
</div>

<script>
  $(function() {
    let isDark = JSON.parse(localStorage.getItem('dark'))  || JSON.parse('false');
    if (isDark) {
      $(".dark-content").replaceWith(
          `
          <div class='dark-content'>
            <i class="fa fa-lightbulb-o" aria-hidden="true"></i>
          </div>
          `
        );
    }
    $('.dark').click(function() {
      if ($(document.body).is('.darkModel')) {
        $(document.body).removeClass('darkModel');
        localStorage.setItem('dark', false);
        $(".dark-content").replaceWith(
          `
          <div class='dark-content'>
            <i class="fa fa-moon-o" aria-hidden="true"></i>
          </div>
          `
        );
      } else {
        $(document.body).addClass('darkModel');
        localStorage.setItem('dark', true);
        $(".dark-content").replaceWith(
          `
          <div class='dark-content'>
            <i class="fa fa-lightbulb-o" aria-hidden="true"></i>
          </div>
          `
        );
      }
    })
  })
</script>
        
      
        <div id="appSearch">
  <div class="search"  @click="showDialog()"><i class="fa fa-search" aria-hidden="true"></i></div>
  <transition name="fade">
    <div class="message-box_wrapper" style="display: none;" v-cloak v-show="dialogVisible" @click.self="cancelDialogVisible()">
      <div class="message-box animated bounceInDown">
        <div class="close" style="overflow: hidden;">
          <i class="fa fa-close" aria-hidden="true" style="float:right;" @click.self="cancelDialogVisible()"></i>
        </div>
        <h2>
          <i class="fa fa-search" aria-hidden="true"></i>
          <span class="title">本地搜索</span>
          <!-- <i class="fa fa-close" style="float:right;" aria-hidden="true" @click.self="cancelDialogVisible()"></i> -->
        </h2>
        <form class="site-search-form">
          <input type="text"
            placeholder="请输入关键字"
            id="local-search-input" 
            @click="getSearchFile()"
            class="st-search-input"
            v-model="searchInput"
          />
        </form>
        <div class="result-wrapper">
          <div id="local-search-result" class="local-search-result-cls"></div>
        </div>
      </div>
    </div>
  </transition>
</div>
<script src="/js/local_search.js"></script>
<script>
  var body = document.body || document.documentElement || window;
  var vm = new Vue({
    el: '#appSearch',
    data: {
      dialogVisible: false,
      searchInput: '',
      top: 0,
    },
    computed: {
    },
    mounted() {
    },
    methods: {
      showDialog() {
        this.dialogVisible = true;
        // 防止页面滚动，只能让弹框滚动
        this.top = $(document).scrollTop()
        body.style.cssText = 'overflow: hidden;';
      },
      getSearchFile() {
        if (!this.searchInput) {
          getSearchFile("/search.xml");
        }
      },
      cancelDialogVisible() {
        this.dialogVisible = false;
        body.removeAttribute('style');
        $(document).scrollTop(this.top)
      },
    },
    created() {}
  })
</script>
<!-- 解决刷新页面闪烁问题，可以在元素上添加display: none, 或者用vue.extend方法，详情：https://blog.csdn.net/qq_31393401/article/details/81017912 -->
<!-- 下面是搜索基本写法 -->
<!-- <script type="text/javascript" id="local.search.active">
  var inputArea = document.querySelector("#local-search-input");
  inputArea.onclick   = function(){ getSearchFile(); this.onclick = null }
  inputArea.onkeydown = function(){ if(event.keyCode == 13) return false }
</script> -->

      

    </nav>
  </div>
  
  <a target="_blank" rel="noopener" href="https://github.com/melvin11112015/" class="github-corner color-primary" aria-label="View source on GitHub"><svg width="60" height="60" viewBox="0 0 250 250" style="fill:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
  
    <div id="he-plugin-simple"></div>
    <script>
      WIDGET = {
        CONFIG: {
          "modules": "012",
          "background": 5,
          "tmpColor": "4A4A4A",
          "tmpSize": 16,
          "cityColor": "4A4A4A",
          "citySize": 16,
          "aqiSize": 16,
          "weatherIconSize": 24,
          "alertIconSize": 18,
          "padding": "10px 10px 10px 10px",
          "shadow": "1",
          "language": "auto",
          "borderRadius": 5,
          "fixed": "false",
          "vertical": "middle",
          "horizontal": "center",
          "key": "2784dd3fcb1e4f0f9a9b579bf69641f2"
        }
      }
    </script>
    <script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script> 
    
</header>
    <main class="main" style="margin-top: 60px;">
      

<div class="bg-dark-floor" style="position: fixed;left: 0;top: 0;width: 100%;height: 100%;z-index: -2;"></div>
<div class="lazyload category-header" data-original="/medias/categoryDetail.jpg" style="width: 100%;height: 50vh;overflow: hidden;background-size: cover; 
background-position: center center;">
</div>
<div class="category">
  <div class="category-name">
    <div class="name" style="background-color: #F9EBEA;">Android 分类</div>
  </div>
  <section class="posts">
    
    <article class="post" data-aos="fade-up"
      style="flex-direction: row-reverse;">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2021-02-19</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2021/02/19/2105/">Android 12 行为变更</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-12/" rel="tag">Android 12</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2021/02/19/2105/" style="background: url('/img/android12-hero.svg');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            用户体验沉浸式手势导航改进Android 12简化了沉浸式模式，使手势导航更加轻松，并且与观看视频和读书等活动的其余部分更加一致。应用仍然可以防止 全屏游戏体验中的意外手势，因此用户在玩游戏时不会意外退出游戏；现在，所有其他全屏或身临其境的
          </div>
        </div>
        <div class="post-more">
          <a href="/2021/02/19/2105/">
            <i class="iconfont iconmore" style="float: right;" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2021/02/19/2105/" style="background: url('/img/android12-hero.svg');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2020-07-11</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2020/07/11/2114/">Android 11 行为变更</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-11/" rel="tag">Android 11</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2020/07/11/2114/" style="background: url('/img/lockup.svg');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            行为变更：所有应用
  Table of contents
  隐私权
  接触史通知
安全性
  SSL 套接字默认情况下使用 Conscrypt SSL 引擎
  Scudo Hardened Allocator
  应用使用情况统计信
          </div>
        </div>
        <div class="post-more">
          <a href="/2020/07/11/2114/">
            <i class="iconfont iconmore" style="" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2020/07/11/2114/" style="background: url('/img/lockup.svg');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="flex-direction: row-reverse;">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2020-07-11</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2020/07/11/2115/">分区存储</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-11/" rel="tag">Android 11</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2020/07/11/2115/" style="background: url('/img/lockup.svg');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            android 10提出了分区存储的概念。开发者无法直接获取外部存储的读写权限，用我们平常的话来说就是无法直接读写SD卡上的东西。  
一. 场景举例PS:如果不知道分区存储是什么个情况，建议在Android11的手机上并设置targetS
          </div>
        </div>
        <div class="post-more">
          <a href="/2020/07/11/2115/">
            <i class="iconfont iconmore" style="float: right;" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2020/07/11/2115/" style="background: url('/img/lockup.svg');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2016-01-04</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2016/01/04/2118/">JNI和Java共享内存空间</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-NDK/" rel="tag">Android NDK</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2016/01/04/2118/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            （1）Java传到JNI，使用GetByteArrayRegion的方式： 该方法的本质是将Java端数组数据拷贝到本地的数组中，所以在JNI对数据修改后Java端的数据并没有改变。 使用GetPrimitiveArrayCritical。
          </div>
        </div>
        <div class="post-more">
          <a href="/2016/01/04/2118/">
            <i class="iconfont iconmore" style="" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2016/01/04/2118/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="flex-direction: row-reverse;">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2016-01-03</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2016/01/03/2116/">什么是JNI?它主要用来干什么。</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-NDK/" rel="tag">Android NDK</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2016/01/03/2116/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            JNI可以这样与本地程序进行交互：1、你可以使用JNI来实现“本地方法”（[native methods](https://baike.baidu.com/item/nativemethods)），并在JAVA程序中调用它们。2、JNI支持
          </div>
        </div>
        <div class="post-more">
          <a href="/2016/01/03/2116/">
            <i class="iconfont iconmore" style="float: right;" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2016/01/03/2116/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2016-01-03</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2016/01/03/2117/">ViewModel</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-Jetpack/" rel="tag">Android Jetpack</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2016/01/03/2117/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            ViewModel的出现确实解决一个简单而又繁琐的问题，大家都知道用户在使用产品的过程中，可能随时会被中断或界面发生重建，如果数据的丢失会造成很差的用户体验，当然现在都知道在onSaveInstanceState()中保存数据，在界面重建时
          </div>
        </div>
        <div class="post-more">
          <a href="/2016/01/03/2117/">
            <i class="iconfont iconmore" style="" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2016/01/03/2117/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="flex-direction: row-reverse;">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2015-11-15</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2015/11/15/2112/">NDK相关(6)</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-NDK/" rel="tag">Android NDK</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2015/11/15/2112/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            2.2.2、为单个的类重载 new[]和 delete[]必须小心对象数组的分配。你可能希望调用到被你重载过的 new 和 delete 操作符，但并不如此。内存的请求被定向到全局的 new[]和 delete[] 操作符，而这些内存来自于
          </div>
        </div>
        <div class="post-more">
          <a href="/2015/11/15/2112/">
            <i class="iconfont iconmore" style="float: right;" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2015/11/15/2112/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2015-11-15</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2015/11/15/2111/">NDK相关(5)</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-NDK/" rel="tag">Android NDK</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2015/11/15/2111/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            2.2、控制 C++的内存分配在嵌入式系统中使用 C++的一个常见问题是内存分配，即对 new 和 delete 操作符的失控。
具有讽刺意味的是，问题的根源却是 C++对内存的管理非常的容易而且安全。具体地说，当一个对象被消除时，它的析构
          </div>
        </div>
        <div class="post-more">
          <a href="/2015/11/15/2111/">
            <i class="iconfont iconmore" style="" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2015/11/15/2111/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="flex-direction: row-reverse;">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2015-11-14</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2015/11/14/2110/">NDK相关(4)</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-NDK/" rel="tag">Android NDK</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2015/11/14/2110/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            2.1.3、堆和栈究竟有什么区别好了，我们回到我们的主题：堆和栈究竟有什么区别？主要的区别由以下几点:
(1). 管理方式不同
(2). 空间大小不同
(3). 能否产生碎片不同
(4). 生长方向不同
(5). 分配方式不同
(6). 分
          </div>
        </div>
        <div class="post-more">
          <a href="/2015/11/14/2110/">
            <i class="iconfont iconmore" style="float: right;" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2015/11/14/2110/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
    <article class="post" data-aos="fade-up"
      style="">
      <div class="post-main">
        <div class="post-info">
          <div class="post-time">
            <i class="fa fa-clock-o" aria-hidden="true"></i>
            <span class="post-time">2015-11-14</span>
          </div>
          <div class="post-title">
            <a class="post-title-link" href="/2015/11/14/2109/">NDK相关(3)</a>
          </div>
          <div class="post-meta">
            <div class="post-tags">
              
    <i class="iconfont icontag"></i>
    <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-NDK/" rel="tag">Android NDK</a></li></ul>

            </div>
            <div class="post-categories">
              
<div class="article-category">
  <i class="iconfont iconbookmark1"></i>
  <a class="article-category-link" href="/categories/Android/">Android</a>
</div>

            </div>
          </div>
          <div class="post-img-mobile">
            <a href="/2015/11/14/2109/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
              background-position: center center;">
            </a>
          </div>
          <div class="post-content">
            C/C++内存管理详解
2.1、内存分配方式2.1.1 简介在 C++中，内存分成 5 个区，他们分别是堆、栈、自由存储区、全局/静态存储区和常量存储区。栈：在执行函数时，函数内局部变量的存储单元都可以在栈上创建，函数执行结束时这些存储单元
          </div>
        </div>
        <div class="post-more">
          <a href="/2015/11/14/2109/">
            <i class="iconfont iconmore" style="" title="阅读更多"></i>
          </a>
        </div>
      </div>
      <div class="post-img">
        <a href="/2015/11/14/2109/" style="background: url('https://ssyerv1.oss-cn-hangzhou.aliyuncs.com/picture/56d7b34ee52046a3af719a1c9b1e0753.jpg!sswm');background-size: cover; 
          background-position: center center;">
        </a>
      </div>
    </article>
    
  </section>
</div>

  <!-- <nav class="page-nav">
    <span class="page-number current">1</span><a class="page-number" href="/categories/Android/page/2/">2</a><a class="extend next" rel="next" href="/categories/Android/page/2/">下一页</a>
  </nav> -->
  <div class="page-nav">
    
    <div class="page-info">
        <div class="page-info-text">1 / 2</div>
    </div>
    
      <a href="/categories/Android/page/2/"
         class="page-nav-next">
          <span class="mr-5">下一页</span><i class="fa fa-angle-right"></i>
      </a>
      
  </div>

    </main>
    <div class="footer bg-color">
  <div class="footer-main">
<!--    <div class="link">
      <a target="_blank" rel="noopener" href="https://github.com/yuang01/hexo-theme-bamboo">
        <i class="fa fa-github" aria-hidden="true"></i>
      </a>
      <a href="mailto:1730241541@qq.com">
        <i class="fa fa-envelope-o" aria-hidden="true"></i>
      </a>
      <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1730241541">
        <i class="fa fa-qq" aria-hidden="true"></i>
      </a>
      <a href="/atom.xml" target="_blank">
        <i class="fa fa-rss" aria-hidden="true"></i>
      </a>
    </div>
-->
    <div class="footer-copyright">
      Copyright © 2015 - 2021 <a href="/about">Melvin</a> | Powered by <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/">Hexo</a> | Theme <a target="_blank" rel="noopener" href="https://github.com/yuang01/theme">Bamboo</a> 
    </div>
    
  </div>
</div>


    
      <div class="goTop top-btn-color border-color">
  <i class="fa fa-arrow-up" aria-hidden="true"></i>
</div>
<script src="/js/goTop.js"></script>
    

    

    <!-- 图片放大 -->
    
      <script src="/js/fancybox/jquery.fancybox.min.js"></script>
    

    <script src="/js/wrapImage.js"></script>
    
    <!-- 爱心点击 -->
    
      
        <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 999; pointer-events: none;" ></canvas>
        <script src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script>
        <script src="/js/cursor/explosion.min.js"></script>
      
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script type="text/javascript" size="100" alpha='0.4' zIndex="-1" src="/js/ribbon.min.js"></script>
    
      <script src="/js/aos/aos.js"></script>
      <script>
        // https://github.com/michalsnik/aos
        const themeOffset = parseInt('120') || 120;
        const themeDelay = parseInt('0')|| 0;
        const themeDuration = parseInt('400') || 400;
        const themeEasing = 'ease' || 'ease';
        const themeOnce = eval('true') || false;
        const themeMirror = eval('false') || false;
        const themeAnchorPlacement = 'top-bottom' || 'top-bottom';
        AOS.init({
          // Global settings:
          disable: false, // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function
          startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on
          initClassName: 'aos-init', // class applied after initialization
          animatedClassName: 'aos-animate', // class applied on animation
          useClassNames: false, // if true, will add content of `data-aos` as classes on scroll
          disableMutationObserver: false, // disables automatic mutations' detections (advanced)
          debounceDelay: 50, // the delay on debounce used while resizing window (advanced)
          throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced)

          // Settings that can be overridden on per-element basis, by `data-aos-*` attributes:
          offset: themeOffset, // offset (in px) from the original trigger point
          delay: themeDelay, // values from 0 to 3000, with step 50ms
          duration: themeDuration, // values from 0 to 3000, with step 50ms
          easing: themeEasing, // default easing for AOS animations
          once: themeOnce, // whether animation should happen only once - while scrolling down
          mirror: themeMirror, // whether elements should animate out while scrolling past them
          anchorPlacement: themeAnchorPlacement, // defines which position of the element regarding to window should trigger the animation

        });
      </script>
    

    
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/v-plugs-ayu/lib/ayu.css">
<script src="https://cdn.jsdelivr.net/npm/v-plugs-ayu/lib/ayu.umd.min.js"></script>
<div id="appCopy">
</div>
<script>
  var vm = new Vue({
    el: '#appCopy',
    data: {
    },
    computed: {
    },
    mounted() {
      const that = this;
      //  监听 ctrl + c事件  
      $(document).unbind('keypress').bind('keypress', function (e) {
        if (e.ctrlKey && e.keyCode == 67) {
          doSomething();
          // 返回false, 防止重复触发copy事件  
          return false;
        }
      })

      // 鼠标右键的复制事件  
      $(document).unbind('copy').bind('copy', function (e) {
        doSomething();
        // console.log('右键复制 监听成功');
      });

      function doSomething() {
        that.$notify({
          title: "成功",
          content: "代码已复制，请遵守相关授权协议。",
          type: 'success'
        })
        // console.log('ctrl + c 监听成功');  
      }
    },
    methods: {
    },
    created() { }
  })
</script>
    

    <!-- 输入框打字特效 -->
    
      <script src="/js/activate-power-mode.js"></script>
      <script>
          POWERMODE.colorful = true;  // 打开随机颜色特效
          POWERMODE.shake = false;    // 关闭输入框抖动
          document.body.addEventListener('input', POWERMODE);//监听打字事件
      </script>
    

    <!-- markdown代码一键复制功能 -->
    <script src="/js/clipboard/clipboard.min.js"></script>
    <script>
      !function (e, t, a) {
        var copy = '复制';
        /* code */
        var initCopyCode = function(){
          var copyHtml = '';
          copyHtml += '<button class="btn-copy" data-clipboard-snippet="" style="position:absolute;top:0;right:0;z-index:1;">';
          copyHtml += '<i class="fa fa-copy"></i><span>' + copy + '</span>';
          copyHtml += '</button>';
          $(".post-detail pre").not('.gutter pre').wrap("<div class='codeBox' style='position:relative;width:100%;'></div>")
          $(".post-detail pre").not('.gutter pre').before(copyHtml);
          new ClipboardJS('.btn-copy', {
              target: function(trigger) {
                  return trigger.nextElementSibling;
              }
          });
        }
        initCopyCode();
      }(window, document);
    </script>

    <script src="/js/lazyload/lazyload@1.9.1.js"></script>
    <script>
      $(function() {
        $("div.lazyload, img.lazyload, a.lazyload").lazyload(
            {
                effect: "fadeIn",
                placeholder: "https://img10.360buyimg.com/ddimg/jfs/t1/159345/8/2271/222193/5ff7b36fEe49f5663/a95287c20385127f.gif"    //图片未加载出来时显示的占位图
            }
        );
    });
    </script>
    
    <script src="/js/app.js"></script>
  </body>
</html>